package com.wxzz.elearing.user.api.server;

import com.wxzz.elearing.user.service.IDocentService;
import com.wxzz.elearning.common.vo.ReturnVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/docent-api")
public class DocentApi {

    @Autowired
    private IDocentService docentService;

    /***
     * 根据讲师id查询讲师详情
     * @param docentId
     * @return
     */
    @RequestMapping(value = "selectDocentById", method = RequestMethod.POST)
    public ReturnVO<String> selectDocentById(@RequestParam("docentId") Long docentId) {
        return docentService.selectDocentById(docentId);
    }

    /**
     * 平台讲师总数
     *
     * @return
     */
    @RequestMapping(value = "countByPlatformDocentNum", method = RequestMethod.POST)
    public Integer countByPlatformDocentNum() {
        return docentService.countByPlatformDocentNum();
    }

    /**
     * 企业讲师总数
     *
     * @return
     */
    @RequestMapping(value = "countByEnterpriseDocentNum", method = RequestMethod.POST)
    public Integer countByEnterpriseDocentNum() {
        return docentService.countByEnterpriseDocentNum();
    }

    /**
     * 根据企业id查询讲师数量
     *
     * @param enterpriseId
     * @return
     */
    @RequestMapping(value = "selectCountByDocent/{enterpriseId}", method = RequestMethod.POST)
    public Integer selectCountByDocent(@PathVariable Long enterpriseId) {
        return docentService.selectCountByDocent(enterpriseId);
    }

}
